package com.uinnova.product.eam.mvc;

import com.binary.framework.bean.annotation.Comment;
import com.binary.framework.web.RemoteResult;
import com.binary.jdbc.Page;
import com.uinnova.product.eam.service.ArchReviewRotaConfService;
import com.uinnova.product.eam.vo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Comment("架构评审值班表配置")
@RequestMapping("/arch/review/rota/conf")
public class ArchReviewRotaConfController {

    @Autowired
    private ArchReviewRotaConfService rotaConfService;

    @PostMapping("/save")
    public RemoteResult save(@RequestBody ArchReviewRotaConfSaveReq req) {
        rotaConfService.save(req);
        return new RemoteResult("success");
    }

    @PostMapping("/checkPre")
    public RemoteResult checkPre(@RequestBody ArchReviewRotaConfSaveReq req) {
        rotaConfService.checkPre(req);
        return new RemoteResult("success");
    }

    @PostMapping("/list")
    public RemoteResult save(@RequestBody ArchReviewRotaConfQueryReq req) {
        Page<ArchReviewRotaConfQueryRes> page = rotaConfService.list(req);
        return new RemoteResult(page);
    }

    @PostMapping("/director/info")
    public RemoteResult rotaDirectorInfo(@RequestBody ArchReviewRotaDirectorInfoReq req) {
        Page<ArchReviewRotaDirectorInfo> page = rotaConfService.rotaDirectorInfo(req);
        return new RemoteResult(page);
    }
}
